package com.oa.ll.dao;

import java.util.List;

import org.apache.struts2.ServletActionContext;
import org.hibernate.criterion.Example;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.oa.domain.Emp;
import com.oa.domain.OaRc;

public class GeRenDaoImpl extends HibernateDaoSupport implements GeRenDao {
	public List<Emp> getEmpByExample(Emp emp) {
		return getSession().createCriteria(Emp.class).add(Example.create(emp)).list();
	}

	//保存密码
	public void updatePass(Emp emp) {
		Emp emp2= (Emp)getSession().createCriteria(Emp.class).add(Example.create(ServletActionContext.getRequest().getSession().getAttribute("emp"))).list().get(0);
		emp2.setEpass(emp.getEpass());
		getSession().update(emp2);
	}
     //保存用户资料修改
	public void updateEmp(Emp emp) {
		getSession().update(emp);
	}

	public List<OaRc> getRcByExample(OaRc rc) {
		return getSession().createCriteria(OaRc.class).add(Example.create(rc)).list();
	}
    //添加日程计划
	public void addRiCheng(OaRc rc) {
	
	}
    //修改日程
	public void updateRiCheng(OaRc rc) {
		
	}

	//删除日程
	public void deleteRiCheng(OaRc rc) {
		
	}
}
